//Sat May  1 14:05:38 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class DNAMatching
{
public:
	int getMaxSize(vector<string> dna)
	{
		int ret = 0;
		for (int i = 0; i < dna.size(); i++)
		{
			for(int j=i+1; j<dna.size(); j++)
				if(check(dna[i]) == dna[j])
					ret++;
		}
		return  dna.size() - ret;
	}
	string check(string dna)
	{
		reverse(dna.begin(), dna.end());
		for (int i = 0; i < (int) dna.size(); i++)
		{
			if (dna[i] == 'A')
			{
				dna[i] = 'T';
			}
			else if (dna[i] == 'T')
			{
				dna[i] = 'A';
			}
			else if (dna[i] == 'C')
			{
				dna[i] = 'G';
			}
			else if (dna[i] == 'G')
			{
				dna[i] = 'C';
			}
		}
		return dna;
	}
};
